import { ecs } from 'db://app-game/libs/ecs/ECS';
import { TableEffects } from '../../../../table/TableEffects';

@ecs.register('EffectsModel')
export class EffectsModelComp extends ecs.Comp {
  table: TableEffects = new TableEffects();
  _id: number = -1;

  get id() {
    return this._id;
  }

  set id(value: number) {
    this._id = value;
    this.table.init(this._id);
  }

  /** 特效名称 */
  get name(): string {
    return this.table.name;
  }
  /** 特效描述 */
  get description(): string {
    return this.table.description;
  }
  /** 预制件路径 */
  get prefabPath(): string {
    return this.table.prefabPath;
  }

  reset(entity: ecs.Entity): void {
    this._id = -1;
  }
}
